home *** CD-ROM | disk | FTP | other *** search
- Path: castle.nando.net!news
- From: actuary@nando.net (Bill McCarthy)
- Newsgroups: comp.lang.c
- Subject: Re: HELP! Memory Problems
- Date: 7 Feb 1996 18:41:47 GMT
- Organization: News & Observer Public Access
- Message-ID: <4farpb$4h2@castle.nando.net>
- References: <4f6f0e$7gg@ntuix.ntu.ac.sg>
- Reply-To: actuary@nando.net (Bill McCarthy)
- NNTP-Posting-Host: grail2317.nando.net
- X-Newsreader: IBM NewsReader/2 v1.2
-
- In <4f6f0e$7gg@ntuix.ntu.ac.sg>, chiapl@bbs.sas.ntu.ac.sg (Chia Puay Long) writes:
- >Hi,
- >
- >My program (compiled using Borland C++ 3.1) hangs when I tried to run it.
- >The program was running fine before I added two array of 512 unsigned
- >character. (using dynamic memory allocation, calloc) I suspected that
- >the PC hangs becos of memory problems.
- >
- >Like to know whether anyone of you has faced such problems? If so,
- >what are the solution available?
- >(I have tried to compile with various memory model and it doesnt work)
-
- If calloc(), malloc() or realloc() fail to allocate the memory requested,
- they return NULL. Always check whether a non-NULL pointer is returned
- before continuing.
-
- Also, unless you're coding for obsolete 16 bit processors, you should
- update your compiler -- BC 3.1 does not support the flat memory model
- available on current compilers.
-
- Bill McCarthy
- actuary@nando.net
- Wendell, NC USA
-
-